-- probably_skill
-- create by shuzy
-- 道具：  概率施放技能

return {
    apply = function(source, target, classId, value)
        if source.type ~= OBJECT_TYPE_USER then
            source = ME.user;
        end
        
        local rand = DungeonM.getRandSeed("probably_skill") % 1000;

        if rand <= value.rate then
        -- 施放技能
            SkillM.apply(source, target, value.skill_id, CombatM.getRound(), { lastRound = value.round });

            -- 抛出使用道具施法事件
            EventMgr.fire(event.PROPERTY_SKILL, { ["classId"] = classId, ["target"] = target, ["skillId"] = value.skill_id });
        end
    end,
};
